package Controls
{
	import Config.GameConfig;
	
	import Objects.GameBitmap;
	import Objects.GameObject;
	import Objects.GameSprite;
	
	import Scenes.GameScene;
	
	import Setup.ZOrder;

	public class Alert extends Panel
	{
		public var okButton:LabelButton;
		public var cancelButton:LabelButton;
		public var text:Text;
		public function Alert()
		{
			super();
			
			okButton=new LabelButton();
			addChild(okButton);
			
			cancelButton=new LabelButton();
			addChild(cancelButton);
			
			text=new Text();
			addChild(text);
		}
		public static function create(message:String,cancel:Boolean=true,modal:Boolean=true):void
		{
			var alert:Alert=new Alert();
			alert.setup(message,cancel);
			alert.born(modal,ZOrder.ALERT);
		}
		public final function setup(message:String,cancel:Boolean):void
		{
			text.textField.htmlText=message;
			if(!cancel)
			{
				cancelButton.obj.visible=false;
			}
			_setup(cancel);
		}
		protected function _setup(cancel:Boolean):void
		{
			
		}
	}
}